# $Id$
# Maintainer: Ronald van Haren <ronald.archlinux.org>
# Contributor: eric <eric@archlinux.org>
# Contributor: Tom Newsom <Jeepster@gmx.co.uk>
 
pkgname=psutils
pkgver=1.17
pkgrel=5
arch=('i686' 'x86_64')
pkgdesc="A set of postscript utilities"
url="http://knackered.org/angus/psutils/"
license=('custom')
depends=('glibc' 'ghostscript')
provides=('psutils-lprng')
replaces=('psutils-lprng')
options=('!makeflags')
source=("https://sources.archlinux.org/other/psutils/${pkgname}-${pkgver}.tar.gz"
        'psutils-1.17.diff')
md5sums=('b161522f3bd1507655326afa7db4a0ad'
         '2b49e9e796000b42f42804d4b50a2be1')

build() {
  cd "${srcdir}/${pkgname}"
  patch -Np1 -i "${srcdir}/psutils-1.17.diff"
  make -f Makefile.unix BINDIR=/usr/bin \
    INCLUDEDIR=/usr/include/psutils PERL=/usr/bin/perl \
    MANDIR=/usr/share/man/man1 \
    CFLAGS="$CFLAGS -DPAPER=\\\"letter\\\" -DUNIX -Wall" \
    CCFLAGS="$LDFLAGS"
}

package() {
  cd "${srcdir}/${pkgname}"
  install -d -m755 "${pkgdir}/usr/include"
  install -d -m755 "${pkgdir}/usr/share/man"
  make -f Makefile.unix BINDIR="${pkgdir}/usr/bin" \
    INCLUDEDIR="${pkgdir}/usr/include/psutils" PERL=/usr/bin/perl \
    MANDIR="${pkgdir}/usr/share/man/man1" install
  install -m755 -d "${pkgdir}/usr/share/licenses/${pkgname}"
  install -m644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/"
}
